<template>
    <div id="reason-root">
        <Header :titleName="'企业智能问数平台'" :titleDesc="'无需编写代码就能完成专业数据洞察（清洗、建模、可视化），即可生成可解释性分析报告'"></Header>
        <div class="reason-container">
            <div class="main-box">
                <div class="main-left-box">
                    <FileUpload v-model:example-file-selected="exampleFileSelected" v-model="files"
                        v-model:res-msg="resMsg" v-model:id="id" v-model:is-uploading="isUploading" />
                </div>
                <div class="main-right-box">
                    <QueryInput v-model:example-file-selected="exampleFileSelected" :files="files"
                        v-model:res-msg="resMsg" v-model:id="id" v-model:is-uploading="isUploading"
                        @example-file-change="handleExampleFileChange"  />
                </div>
            </div>

            <div class="footer">
                <div class="footer-title">
                    <div>泛希诚科技</div>
                    <div>蜀ICP备2025141320号</div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import Header from "@/components/headerView.vue";

import FileUpload from "./fileupload/FileUpload.vue"
import QueryInput from "./queryinput/QueryInput.vue"

export default {
    name: 'ReasonHome',
    components: {
        Header,
        FileUpload,
        QueryInput
    },
    data() {
        return {
            exampleFileSelected: false,
            files: [],
            resMsg: '',
            id: "",
            isUploading: false,
        }
    },
    methods: {
        handleExampleFileChange(val) {
            this.exampleFileSelected = val;
        },
        handleQuerySubmit(query) {
            console.log('提交的问题:', query)

        },
        updateFiles(newFiles) {
            this.files = newFiles;
        },
        updateResMsg(msg) {
            this.resMsg = msg;
        }
        ,
        updateId(id) {
            this.id = id;
        },
        updateIsUploading(val) {
            this.isUploading = val;
        },
    }
}
</script>

<style src="./szyhHome.css" scoped></style>